<?php if(!defined('IN_JOSEPPE')) { exit('Access Denied'); } ?>
<?php
$member = $_SGLOBAL['db']->fetch_all("select * from ".tname("admin_member")." where uid != $_SGLOBAL[supe_uid]");

?>
<?php include_once S_ROOT.'admin/header.php'; ?>
<?php include_once S_ROOT.'admin/menu.php'; ?>
		<div style="margin:0 auto;width:980px;">
		<div id="bd">
			<div class="wrap">
				<p class="title">欢迎来到管理后台</p>
				<p><label>你好：<?php echo $_SGLOBAL['supe_username']; ?></label></p>
				<p><label>你的上次登录时间是：<?php echo date('Y年m月d日，H:i', $_SCOOKIE['lastpost']); ?></label></p>
				<p><label>你的上次登录IP是：　<?php echo $_SCOOKIE['ip']; ?></label></p>
            </div><br/>
			<form action="admin.php" method="post">
			<div class="wrap sec">
				<p class="title">修改登录密码</p>
					<input type="hidden" name="supe_uid" value="<?php echo $_SGLOBAL['supe_uid']; ?>" />
                    <p><label>用户名</label><input type="text" name="supe_username" value="<?php echo $_SGLOBAL['supe_username']; ?>" />
                    <label>原密码</label><input type="password" name="supe_password" value="" /></p>
                    <p><label>新密码</label><input type="password" name="supe_newpassword" value="" />
                    <label>确认新密码</label><input type="password" name="supe_newpassword1" value="" /></p>
            </div><br/>
			<div class="wrap">
				<p class="title">增加管理员</p>
                    <p><label>用户名</label><input type="text" name="new_username" value="" />
                    <label>原密码</label><input type="password" name="new_password" value="" /></p>
            </div><br/>
			<?php if(isset($member) && !empty($member)){ ?>
			<div class="wrap sec">
				<p class="title">管理员维护</p>
					<?php foreach($member as $m){ ?>
					<input type="hidden" name="uid[<?php echo $m['uid']; ?>]" value="<?php echo $m['uid']; ?>" />
                    <p><label>用户名</label><input type="text" name="username[<?php echo $m['uid']; ?>]" value="<?php echo $m['username']; ?>" />
                    <label>原密码</label><input type="password" name="password[<?php echo $m['uid']; ?>]" value="" /></p>
                    <p><label>新密码</label><input type="password" name="newpassword[<?php echo $m['uid']; ?>]" value="" />
                    <label>确认新密码</label><input type="password" name="newpassword1[<?php echo $m['uid']; ?>]" value="" /></p>
					<?php }; ?>
            </div><br/>
			<?php } ?>
			<input type="hidden" name="action" value="admin_member" />
			<input class="submit" type="submit" name="submit" value="提交" />
			</form>
		</div>
		</div>
    </body>
</html>